package com.sea.wechat.request.po;

import com.alibaba.fastjson.JSONObject;
import com.sea.wechat.util.JaxbUtil;


public class TestMseeage {
	public static void main(String[] args) {
		TextMessage message = new TextMessage();
		message.setTouser("123123123");
		message.setMsgtype(MESSAGE_TYPE.文本.getType());
		Text text = new Text();
		text.setContent("测试内容");
		message.setText(text);
		System.out.println(JaxbUtil.convertToXml(message));
		System.out.println(JSONObject.toJSON(message));
		
//		String xml = "<xml><ToUserName><![CDATA[gh_d92f17b3940e]]></ToUserName><FromUserName><![CDATA[o2mDP0YpS5s0C3IMxoU7XrpdEbQ8]]></FromUserName><CreateTime>1501643631</CreateTime><MsgType><![CDATA[text]]></MsgType><Content><![CDATA[你好]]></Content><MsgId>6449510285809455244</MsgId></xml>";
//		TextMessage msg = JaxbUtil.converyToJavaBean(xml, TextMessage.class);
//		System.out.println(msg.getFromUserName());
//		TextMessage msg = new TextMessage();
//		msg.setToUserName("gh_d92f17b3940e");
//		msg.setFromUserName("o2mDP0YpS5s0C3IMxoU7XrpdEbQ8");
//		msg.setCreateTime(1501643631);
//		msg.setContent("你好");
//		msg.setMsgId("6449510285809455244");
//		System.out.println(JaxbUtil.convertToXml(msg));
	}
}
